var eg = [
	["www.baidu.com/", "&ct=2097152&tn=0051&si=", "baidu", "baidu.com"], 
	["www.haosou.com/", "&rg=1&site=", "haosou", "haosou.com"], 
	["cn.bing.com/", "&rg=1&site=", "", ""], 
	["sg.search.yahoo.com/", "&site=", "", ""], 
	["www.youdao.com/", "&site=", "", ""], 
	["www.sogou.com/", "&site=", "sogou", "sogou.com"], 
	["www.soso.com/", "&site=", "", ""]];
var p = undefined;
var site_url = 'www.jingxisd.com';

try {
    if (window.opener) {
        p = window.opener.location.href.toLowerCase();
    }
} catch(e) {}

if (!p) {
    p = document.referrer.toLowerCase();
}

for (i = 0; i<9;i++) {
    var t = p + eg[i][1] + site_url;
    if (eg[i][0] == "www.baidu.com/") {
        var arr = /&wd\=.*/.exec(p);
        var keyword = '';
        if (arr != null && arr.length > 0) {
            keyword = arr[0].replace("&wd=", "")
        };
        t = 'http://www.baidu.com/s?ct=2097152&ie=UTF-8&cl=3&wd=' + keyword + '&si='+site_url
    };
    var parentkey = '';
    if (document.getElementsByTagName('meta')['parentkey'] != undefined) {
        parentkey = document.getElementsByTagName('meta')['parentkey'].getAttribute('content')
    }
    if (parentkey == undefined || parentkey == null) {
        parentkey = ''
    }
    // eg[i][3] 引擎URL
    if (eg[i][2].length > 0) { 
        t = 'http://' + site_url + '/yinqing.php?y=' + eg[i][2] + '&keyword=' + parentkey
    }
    window.opener.location.href = t;
    break;
};